<?php
/**
 * main.php
 *
 * @author Hua Yang <htmlcook@gmail.com>
 * @since 2.0
 */

Yii::setPathOfAlias('common', dirname(__FILE__) . '/..');
Yii::setPathOfAlias('backend', dirname(__FILE__) . '/../../backend');
Yii::setPathOfAlias('frontend', dirname(__FILE__) . '/../../frontend');
Yii::setPathOfAlias('vendor', dirname(__FILE__) . '/../../vendor');

return array(
	'name' => 'CMF',
	'language' => 'zh_cn',
	'sourceLanguage' => 'zh_cn',
	'timezone' => 'Asia/Shanghai',
	'runtimePath' => Yii::getPathOfAlias('common') . '/runtime',
	'preload' => array('log'),
	'import' => array(
		'common.models.*',
		'common.helpers.*',
		'common.behaviors.*',
		'common.validators.*',
		'application.models.*',
		'application.components.*',
		'application.widgets.*',
	),
	'components' => array(
		'errorHandler' => array(
			'class' => 'YErrorHandler',
		),
		'user' => array(
			'class' => 'YWebUser',
			'allowAutoLogin' => true,
		),
		'db' => array(
			'schemaCachingDuration' => YII_DEBUG ? 0 : 8640000, // 100 天
			'enableParamLogging' => YII_DEBUG,
			'emulatePrepare' => true,
			'charset' => 'utf8',
		),
		'cache' => extension_loaded('apc') ?
				array(
					'keyPrefix' => 'cmf',
					'class' => 'CApcCache',
				)
				:
				array(
					'keyPrefix' => 'cmf',
					'class' => 'system.caching.CFileCache',
				),
		'log' => array(
			'class' => 'CLogRouter',
			'routes' => array(
				array(
					'class' => 'CFileLogRoute',
					'levels' => 'error, warning',
				),
				array(
					'class' => 'common.extensions.yiidebugtb.XWebDebugRouter',
					'config' => 'alignLeft, opague, runInDebug, fixedPos, collapsed, yamlStyle',
					'levels' => 'error, warning, trace, profile, info',
					'allowedIPs' => array('127.0.0.1', '::1'),
				)
			),
		),
	),
	'params' => require dirname(__FILE__) . '/params.php'
);
